package com.xnew.common.exception;

import com.xnew.common.response.status.Status;
import com.xnew.common.response.status.StatusCode;

/**
 * @ClassName IllegalException
 * @Description 全局异常类
 * @Author tinx
 * @Date 2019/3/11 0011 下午 4:10
 * @Version 1.0
 **/
public class IllegalException extends RuntimeException{

    private Status status;
    private String message;
    private int code;

    public IllegalException(StatusCode statusCode){
        super(statusCode.getMsg());
        this.status = statusCode;
    }

    public IllegalException(Status status){
        super(status.getMsg());
        this.status = status;
    }

    public IllegalException(String msg){
        super(msg);
        this.message = msg;
    }
    public IllegalException(int code,String msg){
        super(msg);
        this.message = msg;
        this.code = code;
    }

    public Status getStatus(){
        return status;
    }

}
